import { lazy }from 'react';
import { Manager, WapHome, Add ,Cart} from '@react-vant/icons';
export const mainRoute = [
    {
        path:'/Home/Index',
        element:lazy(()=>import('../Page/Home/Index')),
        txt:'首页',
        icon:WapHome
    },
    {
        path:'/Home/Classify',
        element:lazy(()=>import('../Page/Home/Classify')),
        txt:'分类',
        icon:Add
    },
    {
        path:'/Home/Shop',
        element:lazy(()=>import('../Page/Home/Shop')),
        txt:'购物车',
        icon:Cart
    },
    {
        path:'/Home/Me',
        element:lazy(()=>import('../Page/Home/Me')),
        txt:'我的',
        icon:Manager
    },
]

const routes =[
    {
        path:'/Home',
        element:lazy(()=>import('../Page/Home')),
        children:mainRoute
    },
    {
        path:'/Detail/:id',
        element:lazy(()=>import('../Page/Detail')),
    },
    {
        path:'/Login',
        element:lazy(()=>import('../Page/Login')),
    },
    {
        path:'/Add',
        element:lazy(()=>import('../Page/Add')),
    },
    {
        path:'/EditAdd/:id',
        element:lazy(()=>import('../Page/EditAdd')),
    },
    {
        path:'/NewAdd',
        element:lazy(()=>import('../Page/NewAdd')),
    },
    {
        path:'*',
        element:lazy(()=>import('../Page/Erroy404')),
    },
    {
        path:'/',
        to:'/Home/Index'
    }
]

export default routes